﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutomaticPush.Models
{
    /// <summary>
    /// 配置类(需要啥就加到这里面)
    /// </summary>
    public class Configs
    {
        public Configs()
        {
            Publickey = "";
            CpnID = "";
            StoreCode = "";
            ThirdApi = new List<ThirdApiModel>();
            ODBCSetting = new List<OdbcSettingModel>();
        }

        /// <summary>
        /// 是否记录日志
        /// </summary>
        public bool IsLog { set; get; }
        /// <summary>
        /// 是否调试模式
        /// </summary>
        public bool IsDebug { set; get; }

        /// <summary>
        /// ras加密公钥
        /// </summary>
        public string Publickey { set; get; }

        /// <summary>
        /// 是否启用自动推送
        /// </summary>
        public bool PushFlag { set; get; }

        /// <summary>
        /// 推送间隔(分钟)
        /// </summary>
        public int PushTime { set; get; }

        /// <summary>
        /// 推送类型
        /// </summary>
        public int PushType { set; get; }

        /// <summary>
        /// 企业代码
        /// </summary>
        public string CpnID { set; get; }

        /// <summary>
        /// 门店代码
        /// </summary>
        public string StoreCode { set; get; }
        /// <summary>
        /// 三方接口配置
        /// </summary>
        public List<ThirdApiModel> ThirdApi { set; get; }

        /// <summary>
        /// 数据库配置
        /// </summary>
        public List<OdbcSettingModel> ODBCSetting { set; get; }


    }

    /// <summary>
    /// 三方接口参数
    /// </summary>
    public class ThirdApiModel
    {
        public ThirdApiModel()
        {
            Name = "";
            HttpUrl = "";
            AppId = "";
            Key = "";
            Type = "";
            Param = "";
        }
        /// <summary>
        /// 接口名称
        /// </summary>
        public string Name { set; get; }
        /// <summary>
        /// 请求地址
        /// </summary>
        public string HttpUrl { set; get; }
        /// <summary>
        /// appid
        /// </summary>
        public string AppId { set; get; }
        /// <summary>
        /// key
        /// </summary>
        public string Key { set; get; }

        /// <summary>
        /// 类型参数
        /// </summary>
        public string Type { set; get; }

        /// <summary>
        /// 其他参数
        /// </summary>
        public string Param { set; get; }
    }

    /// <summary>
    /// 数据库配置
    /// </summary>
    public class OdbcSettingModel
    { 
        /// <summary>
        /// Odbc
        /// </summary>
        public string Name { set; get; }
        /// <summary>
        /// 读库dsn
        /// </summary>
        public string ReadDSN { set; get; }
        /// <summary>
        /// dsn
        /// </summary>
        public string DSN { set; get; }

        /// <summary>
        ///  用户
        /// </summary>
        public string User { set; get; }

        /// <summary>
        /// 密码
        /// </summary>
        public string PassWord { set; get; }

    }


}
